#include "MovieControlState.h"

MovieControlState::MovieControlState(Movie*& movie, Scene*& scene) 
	: movie(movie),scene(scene), clueCardId(0),channel(0)
{

}

MovieControlState::MovieControlState(const int64_t& clueCardId, const int& channel)
	: movie(NULL), scene(NULL), clueCardId(clueCardId), channel(channel)
{

}

MovieControlState::~MovieControlState()
{
	
}

String MovieControlState::sceneFilePath()
{
	if (movie && scene) {
		return movie->absolutePath(scene->getFilePath());
	}
	return String();
}

const int64_t MovieControlState::getMovieId()
{
	if (movie) {
		return movie->getId();
	}
	return 0;
}

const int MovieControlState::getScene()
{
	if (scene) {
		return scene->getSequence();
	}
	return 0;
}

bool MovieControlState::autoNextScene()
{
	if (scene) {
		return scene->autoNext();
	}
	return false;
}

bool MovieControlState::cyclePlay()
{
	if (scene) {
		return scene->cyclePlay();
	}
	return false;
}

Movie* MovieControlState::getMovie() const
{
	return movie;
}

const int64_t MovieControlState::getClueCardId() const
{
	return clueCardId;
}

const int& MovieControlState::getChannel() const
{
	return channel;
}
